package com.oromwin.repos.data;

import java.io.File;

import com.oromwin.repos.common.Common.Status;

public class MediaTable extends AbstractReposTable {
    private String VolumeId = null;
    private String MediaId = null; 
    private File MediaPath = null;
    private Long MediaMaxBytes = 0L; 
    private Long MediaUsedBytes = 0L; 
    private Integer MediaFileCount = 0; 
    private Status MediaStatus = Status.CREATE;
    private String CreateDate = null;
    private String UpdateDate = null;
    public MediaTable() {
    }
    public MediaTable(String volumeId, String mediaId, File mediaPath, Long mediaMaxBytes, Long mediaUsedBytes, Integer mediaFileCount, Status mediaStatus, String createDate, String updateDate) {
        VolumeId = volumeId;
        MediaId = mediaId;
        MediaPath = mediaPath;
        MediaMaxBytes = mediaMaxBytes;
        MediaUsedBytes = mediaUsedBytes;
        MediaFileCount = mediaFileCount;
        MediaStatus = mediaStatus;
        CreateDate = createDate;
        UpdateDate = updateDate;
    }
    public String getVolumeId() {
        return VolumeId;
    }
    public void setVolumeId(String volumeId) {
        this.VolumeId = volumeId;
    }
    public String getMediaId() {
        return MediaId;
    }
    public void setMediaId(String mediaId) {
        this.MediaId = mediaId;
    }
    public File getMediaPath() {
        return MediaPath;
    }
    public void setMediaPath(File mediaPath) {
        this.MediaPath = mediaPath;
    }
    public Long getMediaMaxBytes() {
        return MediaMaxBytes;
    }
    public void setMediaMaxBytes(Long mediaMaxBytes) {
        this.MediaMaxBytes = mediaMaxBytes;
    }
    public Long getMediaUsedBytes() {
        return MediaUsedBytes;
    }
    public void setMediaUsedBytes(Long mediaUsedBytes) {
        this.MediaUsedBytes = mediaUsedBytes;
    }
    public Integer getMediaFileCount() {
        return MediaFileCount;
    }
    public void setMediaFileCount(Integer mediaFileCount) {
        this.MediaFileCount = mediaFileCount;
    }
    public Integer getMediaStatus() {
        return MediaStatus.ordinal();
    }
    public void setMediaStatus(Integer mediaStatus) {
        this.MediaStatus = Status.values()[mediaStatus];
    }
    public String getCreateDate() {
        return CreateDate;
    }
    public void setCreateDate(String createDate) {
        this.CreateDate = createDate;
    }
    public String getUpdateDate() {
        return UpdateDate;
    }
    public void setUpdateDate(String updateDate) {
        this.UpdateDate = updateDate;
    }
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append(String.format("VolumeId/\t%s\n", VolumeId));
        sb.append(String.format("MediaId/\t%s\n", MediaId));
        sb.append(String.format("MediaPath/\t%s\n", MediaPath));
        sb.append(String.format("MediaMaxBytes/\t%d\n", MediaMaxBytes));
        sb.append(String.format("MediaUsedBytes/\t%d\n", MediaUsedBytes));
        sb.append(String.format("MediaFreeBytes/\t%d\n", getMediaFreeBytes()));
        sb.append(String.format("MediaFileCount/\t%d\n", MediaFileCount));
        sb.append(String.format("MediaStatus/\t%s\n", MediaStatus.toString()));
        sb.append(String.format("CreateDate/\t%s\n", CreateDate.toString()));
        sb.append(String.format("UpdateDate/\t%s\n", UpdateDate.toString()));
        return sb.toString();
    }
    public Long getMediaFreeBytes() {
        return MediaMaxBytes - MediaUsedBytes;
    }
}
